package com.hue.netty.day03.rpc.netty;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.codec.string.StringDecoder;
import io.netty.handler.codec.string.StringEncoder;

public class NettyServerInitializer extends ChannelInitializer<SocketChannel> {
    @Override
    protected void initChannel(SocketChannel ch) throws Exception {
        ch.pipeline().
                //字符串解码器
                addLast(new StringDecoder()).
                //字符串编码器
                addLast(new StringEncoder()).
                addLast(new NettyServerHandler());
    }
}
